package cheme.ProcessModel;

import java.util.ArrayList;
import java.util.List;

import cheme.ProcessModel.Visitors.IModelVisitor;

public class ContentsModel extends AbstractParent<IChild> implements IProcessModel
{
	
	private static final long serialVersionUID = 1L;
	private static String me = "cheme.ProcessModel.ContentsModel";
	
	private List<Object> children = new ArrayList<Object>();
	protected static String getSet = "-getSet";

	public ContentsModel(IModelElement parent) {
		super(parent);
		// TODO Auto-generated constructor stub
	}
	
	public static final String P_CHILDREN = "_children";

	public void addChild(Object child)
	{
		SimpleLogger.log(me + getSet, me + ".addChild(child)");
		children.add(child);
		
		/*
		 * Note that both the 'new' and 'old' values are currently left null (v4)
		 */
		firePropertyChange(P_CHILDREN, null, null);
	}
	
	public void removeChild(Object child)
	{
		SimpleLogger.log(me + getSet, me + ".removeChild(child)");
		
		children.remove(child);

		/*
		 * Note that both the 'new' and 'old' values are currently left null (v4)
		 */
		firePropertyChange(P_CHILDREN, null, null);
	}

	public List getChildren()
	{
		SimpleLogger.log(me + getSet, me + ".getChildren()");
		
		return children;
	}

	

	@Override
	public Object accept(IModelVisitor visitor) {
		// TODO Auto-generated method stub
		return null;
	}

}
